/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * vwAanmeldenBatch.java
 *
 * Created on May 9, 2011, 10:00:54 PM
 */
package tcnplanner;

import java.util.Date;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;

/**
 *
 * @author Koen
 */
public class vwAanmeldenBatch extends javax.swing.JPanel {

    /** Creates new form vwAanmeldenBatch */
    public vwAanmeldenBatch() {
        initComponents();
        setSpinner();
       
        this.vwRegistrerenEquipment.plProber.setVisible(true);
        this.vwRegistrerenEquipment.plHandler.setVisible(false);
        this.plTDPProbeCard.setVisible(true);
        this.lbWaferProducts.setText("Wafers");
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbAanmeldenBatch = new javax.swing.JLabel();
        vwRegistrerenEquipment = new tcnplanner.vwRegistrerenEquipment();
        plTDPProbeCard = new javax.swing.JPanel();
        tfProbeCard = new javax.swing.JTextField();
        lbTDP = new javax.swing.JLabel();
        tfTDP = new javax.swing.JTextField();
        lbProbeCard = new javax.swing.JLabel();
        plTypeProduct = new javax.swing.JPanel();
        cbTypeBatch = new javax.swing.JComboBox();
        lbType = new javax.swing.JLabel();
        lbProduct = new javax.swing.JLabel();
        tfProduct = new javax.swing.JTextField();
        lbWaferProducts = new javax.swing.JLabel();
        spAantal = new javax.swing.JSpinner();
        jLabel3 = new javax.swing.JLabel();
        plDueDate = new javax.swing.JPanel();
        plResDate = new javax.swing.JPanel();
        dpDate = new org.jdesktop.swingx.JXDatePicker();
        lbReservationdate = new javax.swing.JLabel();
        spHoure = new javax.swing.JSpinner();
        lbReservationdate1 = new javax.swing.JLabel();

        setBackground(java.awt.SystemColor.inactiveCaption);

        lbAanmeldenBatch.setText("Aanmelden batch");
        lbAanmeldenBatch.setName("lbAanmeldenBatch"); // NOI18N

        vwRegistrerenEquipment.setName("vwRegistrerenEquipment"); // NOI18N

        plTDPProbeCard.setBackground(java.awt.SystemColor.inactiveCaption);
        plTDPProbeCard.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        plTDPProbeCard.setName("plTDPProbeCard"); // NOI18N

        tfProbeCard.setText("PROBECARD");
        tfProbeCard.setName("tfProbeCard"); // NOI18N

        lbTDP.setText("TDP");
        lbTDP.setName("lbTDP"); // NOI18N

        tfTDP.setText("TDP");
        tfTDP.setName("tfTDP"); // NOI18N

        lbProbeCard.setText("Probe card");
        lbProbeCard.setName("lbProbeCard"); // NOI18N

        javax.swing.GroupLayout plTDPProbeCardLayout = new javax.swing.GroupLayout(plTDPProbeCard);
        plTDPProbeCard.setLayout(plTDPProbeCardLayout);
        plTDPProbeCardLayout.setHorizontalGroup(
            plTDPProbeCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, plTDPProbeCardLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(plTDPProbeCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbTDP)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, plTDPProbeCardLayout.createSequentialGroup()
                        .addComponent(lbProbeCard)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(plTDPProbeCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(tfTDP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)
                            .addComponent(tfProbeCard, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        plTDPProbeCardLayout.setVerticalGroup(
            plTDPProbeCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plTDPProbeCardLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(plTDPProbeCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbTDP)
                    .addComponent(tfTDP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(plTDPProbeCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbProbeCard)
                    .addComponent(tfProbeCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        plTypeProduct.setBackground(java.awt.SystemColor.inactiveCaption);
        plTypeProduct.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        plTypeProduct.setName("plTypeProduct"); // NOI18N

        cbTypeBatch.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Waferbatch", "Finished products" }));
        cbTypeBatch.setName("cbTypeBatch"); // NOI18N
        cbTypeBatch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbTypeBatchActionPerformed(evt);
            }
        });

        lbType.setText("Type");
        lbType.setName("lbType"); // NOI18N

        lbProduct.setText("Product");
        lbProduct.setName("lbProduct"); // NOI18N

        tfProduct.setText("TestProduct");
        tfProduct.setName("tfProduct"); // NOI18N

        lbWaferProducts.setText("Producten/Wafers");
        lbWaferProducts.setName("lbWaferProducts"); // NOI18N

        spAantal.setName("spAantal"); // NOI18N
        spAantal.setValue(1000);

        jLabel3.setText("Aantal");
        jLabel3.setName("jLabel3"); // NOI18N

        javax.swing.GroupLayout plTypeProductLayout = new javax.swing.GroupLayout(plTypeProduct);
        plTypeProduct.setLayout(plTypeProductLayout);
        plTypeProductLayout.setHorizontalGroup(
            plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plTypeProductLayout.createSequentialGroup()
                .addGroup(plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, plTypeProductLayout.createSequentialGroup()
                            .addComponent(lbProduct)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(tfProduct))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, plTypeProductLayout.createSequentialGroup()
                            .addComponent(lbType)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cbTypeBatch, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(plTypeProductLayout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(spAantal, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbWaferProducts)))
                .addContainerGap(240, Short.MAX_VALUE))
        );
        plTypeProductLayout.setVerticalGroup(
            plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plTypeProductLayout.createSequentialGroup()
                .addGroup(plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbType)
                    .addComponent(cbTypeBatch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbProduct)
                    .addComponent(tfProduct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(plTypeProductLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(spAantal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbWaferProducts))
                .addContainerGap(20, Short.MAX_VALUE))
        );

        plDueDate.setBackground(java.awt.SystemColor.inactiveCaption);
        plDueDate.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        plDueDate.setName("plDueDate"); // NOI18N

        plResDate.setBackground(java.awt.SystemColor.inactiveCaption);
        plResDate.setName("plResDate"); // NOI18N

        dpDate.setDate(new Date());
        dpDate.setName("dpDate"); // NOI18N

        lbReservationdate.setText("Reserverings datum");
        lbReservationdate.setName("lbReservationdate"); // NOI18N

        javax.swing.GroupLayout plResDateLayout = new javax.swing.GroupLayout(plResDate);
        plResDate.setLayout(plResDateLayout);
        plResDateLayout.setHorizontalGroup(
            plResDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plResDateLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(plResDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbReservationdate)
                    .addComponent(dpDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        plResDateLayout.setVerticalGroup(
            plResDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plResDateLayout.createSequentialGroup()
                .addComponent(lbReservationdate, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(dpDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(12, Short.MAX_VALUE))
        );

        spHoure.setName("Hourepicker"); // NOI18N
        spHoure.setValue(1);
        spHoure.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                spHoureStateChanged(evt);
            }
        });

        lbReservationdate1.setText("Houre of the day:");
        lbReservationdate1.setName("lbReservationdate1"); // NOI18N

        javax.swing.GroupLayout plDueDateLayout = new javax.swing.GroupLayout(plDueDate);
        plDueDate.setLayout(plDueDateLayout);
        plDueDateLayout.setHorizontalGroup(
            plDueDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plDueDateLayout.createSequentialGroup()
                .addComponent(plResDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 190, Short.MAX_VALUE)
                .addGroup(plDueDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lbReservationdate1)
                    .addComponent(spHoure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        plDueDateLayout.setVerticalGroup(
            plDueDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(plDueDateLayout.createSequentialGroup()
                .addGroup(plDueDateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(plResDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(plDueDateLayout.createSequentialGroup()
                        .addComponent(lbReservationdate1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(spHoure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(112, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(plTypeProduct, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lbAanmeldenBatch)
                    .addComponent(plDueDate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(plTDPProbeCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(vwRegistrerenEquipment, javax.swing.GroupLayout.DEFAULT_SIZE, 426, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(lbAanmeldenBatch)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(plTypeProduct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(vwRegistrerenEquipment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(plTDPProbeCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(plDueDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void cbTypeBatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbTypeBatchActionPerformed
        // TODO add your handling code here:
        int sel = this.cbTypeBatch.getSelectedIndex();
        switch (sel) {
            case 0:
                this.vwRegistrerenEquipment.plProber.setVisible(true);
                this.vwRegistrerenEquipment.plHandler.setVisible(false);
                this.plTDPProbeCard.setVisible(true);
                this.lbWaferProducts.setText("Wafers");
                break;
            case 1:
                this.vwRegistrerenEquipment.plProber.setVisible(false);
                this.vwRegistrerenEquipment.plHandler.setVisible(true);
                this.plTDPProbeCard.setVisible(false);
                this.lbWaferProducts.setText("Products");
                break;
        }
    }//GEN-LAST:event_cbTypeBatchActionPerformed

    private void spHoureStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spHoureStateChanged
        
    }//GEN-LAST:event_spHoureStateChanged

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JComboBox cbTypeBatch;
    public org.jdesktop.swingx.JXDatePicker dpDate;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel lbAanmeldenBatch;
    private javax.swing.JLabel lbProbeCard;
    private javax.swing.JLabel lbProduct;
    private javax.swing.JLabel lbReservationdate;
    private javax.swing.JLabel lbReservationdate1;
    private javax.swing.JLabel lbTDP;
    private javax.swing.JLabel lbType;
    private javax.swing.JLabel lbWaferProducts;
    private javax.swing.JPanel plDueDate;
    private javax.swing.JPanel plResDate;
    private javax.swing.JPanel plTDPProbeCard;
    private javax.swing.JPanel plTypeProduct;
    public javax.swing.JSpinner spAantal;
    public javax.swing.JSpinner spHoure;
    public javax.swing.JTextField tfProbeCard;
    public javax.swing.JTextField tfProduct;
    public javax.swing.JTextField tfTDP;
    public tcnplanner.vwRegistrerenEquipment vwRegistrerenEquipment;
    // End of variables declaration//GEN-END:variables

    private void setSpinner() {
        int houre =12;
         SpinnerModel model = new SpinnerNumberModel(houre, //initial value
                               houre - 12, //min
                               houre + 11, //max
                               1);  
        
        this.spHoure.setModel(model);
    }
}
